In [1]:
import pandas as pd
In [7]:
txt_df = pd.read_csv('test.txt', names=['id', 'city', 'population'], encoding='cp1251')
txt_df
Out[7]:
id city population
0 1 Кабул 1780000
1 2 Кандагар 237500
In [11]:
cities = pd.read_csv('city.csv', sep=';', names=['id', 'city', 'code', 'district', 'population'], header=0)
cities
Out[11]:
id city code district population
0 1 Kabul AFG Kabol 1780000
1 2 Qandahar AFG Qandahar 237500
2 3 Herat AFG Herat 186800
3 4 Mazar-e-Sharif AFG Balkh 127800
4 5 Amsterdam NLD Noord-Holland 731200
... ... ... ... ... ...
4074 4075 Khan Yunis PSE Khan Yunis 123175
4075 4076 Hebron PSE Hebron 119401
4076 4077 Jabaliya PSE North Gaza 113901
4077 4078 Nablus PSE Nablus 100231
4078 4079 Rafah PSE Rafah 92020

4079 rows × 5 columns

In [12]:
wiki_df = pd.read_html('https://ru.wikipedia.org/wiki/%D0%A2%D0%B0%D0%B1%D0%BB%D0%B8%D1%86%D0%B0')
wiki_df
Out[12]:
[    Фамилия        Имя      Отчество
 0    Пашков     Сергей  Владимирович
 1   Лобанов       Петр    Богданович
 2   Воронов  Святослав  Владимирович
 3  Левицкий   Анатолий    Алексеевич
 4  Кузнецов      Роман      Осипович
 5    Ярошко     Сергей      Адамович,
    ×  1  2  3
 0  1  1  2  3
 1  2  2  4  6
 2  3  3  6  9,
            +                 1                   2                3
 0       Олег     Воронков Олег          Котов Олег     Сахаров Олег
 1  Александр  Власов Александр  Тимченко Александр  Лядов Александр,
     0                                                  1
 0 NaN  Это заготовка статьи. Вы можете помочь проекту...]
In [18]:
names_df = wiki_df[0]
In [19]:
names_df.columns = ['surname', 'name', 'ttt']
In [20]:
names_df
Out[20]:
surname name ttt
0 Пашков Сергей Владимирович
1 Лобанов Петр Богданович
2 Воронов Святослав Владимирович
3 Левицкий Анатолий Алексеевич
4 Кузнецов Роман Осипович
5 Ярошко Сергей Адамович
In [22]:
pd.read_json('https://jsonplaceholder.typicode.com/users')
Out[22]:
id name username email address phone website company
0 1 Leanne Graham Bret Sincere@april.biz {'street': 'Kulas Light', 'suite': 'Apt. 556',... 1-770-736-8031 x56442 hildegard.org {'name': 'Romaguera-Crona', 'catchPhrase': 'Mu...
1 2 Ervin Howell Antonette Shanna@melissa.tv {'street': 'Victor Plains', 'suite': 'Suite 87... 010-692-6593 x09125 anastasia.net {'name': 'Deckow-Crist', 'catchPhrase': 'Proac...
2 3 Clementine Bauch Samantha Nathan@yesenia.net {'street': 'Douglas Extension', 'suite': 'Suit... 1-463-123-4447 ramiro.info {'name': 'Romaguera-Jacobson', 'catchPhrase': ...
3 4 Patricia Lebsack Karianne Julianne.OConner@kory.org {'street': 'Hoeger Mall', 'suite': 'Apt. 692',... 493-170-9623 x156 kale.biz {'name': 'Robel-Corkery', 'catchPhrase': 'Mult...
4 5 Chelsey Dietrich Kamren Lucio_Hettinger@annie.ca {'street': 'Skiles Walks', 'suite': 'Suite 351... (254)954-1289 demarco.info {'name': 'Keebler LLC', 'catchPhrase': 'User-c...
5 6 Mrs. Dennis Schulist Leopoldo_Corkery Karley_Dach@jasper.info {'street': 'Norberto Crossing', 'suite': 'Apt.... 1-477-935-8478 x6430 ola.org {'name': 'Considine-Lockman', 'catchPhrase': '...
6 7 Kurtis Weissnat Elwyn.Skiles Telly.Hoeger@billy.biz {'street': 'Rex Trail', 'suite': 'Suite 280', ... 210.067.6132 elvis.io {'name': 'Johns Group', 'catchPhrase': 'Config...
7 8 Nicholas Runolfsdottir V Maxime_Nienow Sherwood@rosamond.me {'street': 'Ellsworth Summit', 'suite': 'Suite... 586.493.6943 x140 jacynthe.com {'name': 'Abernathy Group', 'catchPhrase': 'Im...
8 9 Glenna Reichert Delphine Chaim_McDermott@dana.io {'street': 'Dayna Park', 'suite': 'Suite 449',... (775)976-6794 x41206 conrad.com {'name': 'Yost and Sons', 'catchPhrase': 'Swit...
9 10 Clementina DuBuque Moriah.Stanton Rey.Padberg@karina.biz {'street': 'Kattie Turnpike', 'suite': 'Suite ... 024-648-3804 ambrose.net {'name': 'Hoeger LLC', 'catchPhrase': 'Central...
In [ ]: